Add copy-to-clipboard button for scan_display_id#142
Conversation
|
@saitejasviputta is attempting to deploy a commit to the karan3431's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
🎉 Thank you for your Pull Request! We're thrilled to have your contribution to FreshScan AI. Before we review, please make sure you have:
A maintainer will review your code as soon as possible! |
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesClipboard copy UI
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/ResultsPage.tsx`:
- Line 65: The catch block in ResultsPage’s error handling currently declares an
unused `error` binding, which will trip ESLint. Update the `catch` clause to
either remove the parameter entirely or use it meaningfully in the ResultsPage
logic (for example, logging or telemetry) so the `catch` around this code no
longer contains an unused variable.
- Around line 157-166: The Copy control inside ResultsPage’s card Link is
currently an SVG click target, so it triggers navigation to /analysis and isn’t
keyboard accessible. Replace the Copy icon usage with a real button in the
ResultsPage card markup, and in its click handler call preventDefault() and
stopPropagation() before invoking copyScanId. Keep the existing copyScanId
behavior, but make sure the interactive element is the button rather than the
icon component itself.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 49d1bd0b-ba22-40e2-ba77-9b3325099ac1
📒 Files selected for processing (1)
src/pages/ResultsPage.tsx
|
Great start! The scan_display_id copy button is working perfectly. However, the issue also requires a copy button next to the public report URL (/report/:id). Could you add that as well before we merge? |
|
Hello @jpdevhub , |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/PublicReport.tsx`:
- Around line 31-34: The copy-to-clipboard logic in PublicReport’s copyReportUrl
should use the canonical report route instead of window.location.href, since the
current URL may include query/hash state. Update copyReportUrl to build the
share link from window.location.origin and the report id so it always copies the
/report/:id URL, and make sure any other report URL copy/share paths referenced
in the same component use the same canonical construction.
- Around line 103-107: The Copy icon in PublicReport lacks keyboard-accessible
button semantics because the click handler is attached directly to the icon
component. Update the PublicReport component so the copy action is triggered by
a real button wrapping the Copy icon, and keep the icon decorative inside it.
Preserve the existing copyReportUrl behavior and styling by moving the click
handler, title/label, and cursor/hover affordances to the button element.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 37fa1dae-4f57-4160-88d7-3c6a4d89e938
📒 Files selected for processing (2)
src/pages/PublicReport.tsxsrc/pages/ResultsPage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/pages/ResultsPage.tsx
|
Their are merge conflicts resolve that carefully |
|
@jpdevhub, Thanks for the feedback! I've fixed the CI issues. The PR is ready for another review. Please let me know if any other changes are needed. |
|
Hey @saitejasviputta, thanks for updating the PR! The logic looks good, but there's a critical issue that breaks the build. Could you fix these before we merge?
Once these two things are fixed, I'll go ahead and merge! |
|
Hello @jpdevhub ,
The latest changes have been pushed. Please let me know if there's anything else that needs to be adjusted. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
src/pages/PublicReport.tsx (3)
33-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated clipboard-copy-with-toast pattern across files.
copyReportUrlhere duplicates the try/catch/toast structure ofcopyScanIdinsrc/pages/ResultsPage.tsx, and a third variant insrc/pages/ScannerPage.tsxuses yet another pattern (booleancopiedstate, no toast). Consider extracting a sharedcopyToClipboard(text, successMessage, errorMessage)helper/hook to keep behavior consistent and reduce future drift.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/PublicReport.tsx` around lines 33 - 44, The clipboard-copy flow in copyReportUrl duplicates the same try/catch/toast pattern used by copyScanId and diverges from ScannerPage, so extract a shared copyToClipboard helper or hook and use it here instead. Move the clipboard write plus success/error toast handling into the shared utility, then have PublicReport’s copyReportUrl call that helper with the report URL and its success/error messages so all three pages behave consistently.
37-44: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winNew copy-to-clipboard strings bypass i18n.
Every other user-facing string in this file was converted to
t(...)(headings, terminal messages, button label), but the new"PUBLIC REPORT URL"heading,aria-label/title="Copy Public Report URL", and the toast messages ('Public report URL copied!','Failed to copy public report URL.') remain hardcoded English. This leaves non-English users with a mixed-language UI.💬 Proposed fix
const copyReportUrl = async () => { try { await navigator.clipboard.writeText(reportUrl); - toast.success('Public report URL copied!'); + toast.success(t('publicReport.urlCopied')); } catch { - toast.error('Failed to copy public report URL.'); + toast.error(t('publicReport.urlCopyFailed')); } }; @@ <p className="font-mono text-[0.65rem] tracking-widest text-on-surface-variant mb-2 uppercase"> - PUBLIC REPORT URL + {t('publicReport.reportUrlLabel')} </p> @@ <button type="button" onClick={copyReportUrl} - aria-label="Copy public report URL" - title="Copy Public Report URL" + aria-label={t('publicReport.copyUrlAria')} + title={t('publicReport.copyUrlTitle')} className="shrink-0 ml-3 text-on-surface-variant hover:text-neon" >Also applies to: 101-121
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/PublicReport.tsx` around lines 37 - 44, The new copy-to-clipboard UI strings in PublicReport are still hardcoded English, so update the heading, copy button aria-label/title, and both toast messages to use the existing i18n pattern with t(...). Use the same translation approach already used elsewhere in PublicReport.tsx and keep the string keys consistent around the copyReportUrl handler and the “PUBLIC REPORT URL” section so all user-facing text is localized.
1-135: 📐 Maintainability & Code Quality | 🔵 TrivialPR complexity label:
complexity: basic.This change adds a contained clipboard-copy UI control (icon, handler, toast) to an existing page without introducing new endpoints, state machines, or architectural changes — fits "small UI tweaks, simple bug fixes."
As per path instructions, "Analyze the code changes and the PR description... automatically apply ONE of the following labels to the PR."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/PublicReport.tsx` around lines 1 - 135, The PR description says this change should automatically apply a single complexity label, but the current `PublicReport` update only adds the clipboard UI and does not reflect any labeling behavior. Update the PR/labeling logic associated with this change so it assigns the correct one label (`complexity: basic`) based on the described scope, and verify the label selection flow uses the existing review/analysis output rather than hardcoding page UI details.Source: Path instructions
src/pages/ResultsPage.tsx (1)
76-83: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winToast copy strings bypass i18n.
The rest of this file's user-facing strings are translated via
t(...), but'Scan ID copied to clipboard!'and'Failed to copy Scan ID.'are hardcoded English, breaking localization consistency.💬 Proposed fix
const copyScanId = async (scanId: string) => { try { await navigator.clipboard.writeText(scanId); - toast.success('Scan ID copied to clipboard!'); + toast.success(t('results.scanIdCopied')); } catch { - toast.error('Failed to copy Scan ID.'); + toast.error(t('results.scanIdCopyFailed')); } };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/ResultsPage.tsx` around lines 76 - 83, The copyScanId helper in ResultsPage uses hardcoded toast text, bypassing the file’s i18n pattern. Replace the success and error strings in copyScanId with t(...) lookups matching the other user-facing messages in ResultsPage, and ensure the translation keys are added/used consistently so the clipboard toasts are localized.
♻️ Duplicate comments (1)
src/pages/ResultsPage.tsx (1)
142-186: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winCopy button still triggers card navigation — previous fix incomplete.
The Copy button is nested inside the card's
<Link to={\/analysis?id=${h.id}`}>(opened at line 142). TheonClickhandler at line 179 only callscopyScanId; it never callspreventDefault()/stopPropagation(), so the click still bubbles to the anchor and navigates to/analysisinstead of (or alongside) copying. This was previously flagged and is only half-fixed — wrapping in a realwas done, but the event handling was not. Nesting ainside an` is also invalid HTML.🐛 Proposed fix
<button type="button" - onClick={() => copyScanId(h.scan_display_id)} - aria-label="Copy Scan ID" + onClick={(event) => { + event.preventDefault(); + event.stopPropagation(); + void copyScanId(h.scan_display_id); + }} + aria-label={`Copy scan ID ${h.scan_display_id}`} title="Copy Scan ID" className="shrink-0 ml-2 text-on-surface-variant hover:text-neon" >🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/ResultsPage.tsx` around lines 142 - 186, The Copy button inside the ResultsPage card Link still bubbles to the surrounding navigation, so clicking it can trigger /analysis instead of only copying the scan ID. Update the Copy button handler in ResultsPage so it prevents the parent Link navigation by calling preventDefault and stopPropagation before copyScanId, and avoid keeping an interactive button nested inside the Link by restructuring the card actions if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/ResultsPage.tsx`:
- Around line 63-66: The retry button in ResultsPage currently relies on the
default button type, which can accidentally act as a submit button inside a
form. Update the button in ResultsPage to explicitly set type="button" while
keeping the existing onClick reload behavior and styling, so it only triggers
the page refresh action.
---
Outside diff comments:
In `@src/pages/PublicReport.tsx`:
- Around line 33-44: The clipboard-copy flow in copyReportUrl duplicates the
same try/catch/toast pattern used by copyScanId and diverges from ScannerPage,
so extract a shared copyToClipboard helper or hook and use it here instead. Move
the clipboard write plus success/error toast handling into the shared utility,
then have PublicReport’s copyReportUrl call that helper with the report URL and
its success/error messages so all three pages behave consistently.
- Around line 37-44: The new copy-to-clipboard UI strings in PublicReport are
still hardcoded English, so update the heading, copy button aria-label/title,
and both toast messages to use the existing i18n pattern with t(...). Use the
same translation approach already used elsewhere in PublicReport.tsx and keep
the string keys consistent around the copyReportUrl handler and the “PUBLIC
REPORT URL” section so all user-facing text is localized.
- Around line 1-135: The PR description says this change should automatically
apply a single complexity label, but the current `PublicReport` update only adds
the clipboard UI and does not reflect any labeling behavior. Update the
PR/labeling logic associated with this change so it assigns the correct one
label (`complexity: basic`) based on the described scope, and verify the label
selection flow uses the existing review/analysis output rather than hardcoding
page UI details.
In `@src/pages/ResultsPage.tsx`:
- Around line 76-83: The copyScanId helper in ResultsPage uses hardcoded toast
text, bypassing the file’s i18n pattern. Replace the success and error strings
in copyScanId with t(...) lookups matching the other user-facing messages in
ResultsPage, and ensure the translation keys are added/used consistently so the
clipboard toasts are localized.
---
Duplicate comments:
In `@src/pages/ResultsPage.tsx`:
- Around line 142-186: The Copy button inside the ResultsPage card Link still
bubbles to the surrounding navigation, so clicking it can trigger /analysis
instead of only copying the scan ID. Update the Copy button handler in
ResultsPage so it prevents the parent Link navigation by calling preventDefault
and stopPropagation before copyScanId, and avoid keeping an interactive button
nested inside the Link by restructuring the card actions if needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5b815e8b-8dcc-4b2b-b0a8-b92c10867c06
📒 Files selected for processing (2)
src/pages/PublicReport.tsxsrc/pages/ResultsPage.tsx
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
src/pages/PublicReport.tsx (3)
33-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated clipboard-copy-with-toast pattern across files.
copyReportUrlhere duplicates the try/catch/toast structure ofcopyScanIdinsrc/pages/ResultsPage.tsx, and a third variant insrc/pages/ScannerPage.tsxuses yet another pattern (booleancopiedstate, no toast). Consider extracting a sharedcopyToClipboard(text, successMessage, errorMessage)helper/hook to keep behavior consistent and reduce future drift.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/PublicReport.tsx` around lines 33 - 44, The clipboard-copy flow in copyReportUrl duplicates the same try/catch/toast pattern used by copyScanId and diverges from ScannerPage, so extract a shared copyToClipboard helper or hook and use it here instead. Move the clipboard write plus success/error toast handling into the shared utility, then have PublicReport’s copyReportUrl call that helper with the report URL and its success/error messages so all three pages behave consistently.
37-44: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winNew copy-to-clipboard strings bypass i18n.
Every other user-facing string in this file was converted to
t(...)(headings, terminal messages, button label), but the new"PUBLIC REPORT URL"heading,aria-label/title="Copy Public Report URL", and the toast messages ('Public report URL copied!','Failed to copy public report URL.') remain hardcoded English. This leaves non-English users with a mixed-language UI.💬 Proposed fix
const copyReportUrl = async () => { try { await navigator.clipboard.writeText(reportUrl); - toast.success('Public report URL copied!'); + toast.success(t('publicReport.urlCopied')); } catch { - toast.error('Failed to copy public report URL.'); + toast.error(t('publicReport.urlCopyFailed')); } }; @@ <p className="font-mono text-[0.65rem] tracking-widest text-on-surface-variant mb-2 uppercase"> - PUBLIC REPORT URL + {t('publicReport.reportUrlLabel')} </p> @@ <button type="button" onClick={copyReportUrl} - aria-label="Copy public report URL" - title="Copy Public Report URL" + aria-label={t('publicReport.copyUrlAria')} + title={t('publicReport.copyUrlTitle')} className="shrink-0 ml-3 text-on-surface-variant hover:text-neon" >Also applies to: 101-121
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/PublicReport.tsx` around lines 37 - 44, The new copy-to-clipboard UI strings in PublicReport are still hardcoded English, so update the heading, copy button aria-label/title, and both toast messages to use the existing i18n pattern with t(...). Use the same translation approach already used elsewhere in PublicReport.tsx and keep the string keys consistent around the copyReportUrl handler and the “PUBLIC REPORT URL” section so all user-facing text is localized.
1-135: 📐 Maintainability & Code Quality | 🔵 TrivialPR complexity label:
complexity: basic.This change adds a contained clipboard-copy UI control (icon, handler, toast) to an existing page without introducing new endpoints, state machines, or architectural changes — fits "small UI tweaks, simple bug fixes."
As per path instructions, "Analyze the code changes and the PR description... automatically apply ONE of the following labels to the PR."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/PublicReport.tsx` around lines 1 - 135, The PR description says this change should automatically apply a single complexity label, but the current `PublicReport` update only adds the clipboard UI and does not reflect any labeling behavior. Update the PR/labeling logic associated with this change so it assigns the correct one label (`complexity: basic`) based on the described scope, and verify the label selection flow uses the existing review/analysis output rather than hardcoding page UI details.Source: Path instructions
src/pages/ResultsPage.tsx (1)
76-83: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winToast copy strings bypass i18n.
The rest of this file's user-facing strings are translated via
t(...), but'Scan ID copied to clipboard!'and'Failed to copy Scan ID.'are hardcoded English, breaking localization consistency.💬 Proposed fix
const copyScanId = async (scanId: string) => { try { await navigator.clipboard.writeText(scanId); - toast.success('Scan ID copied to clipboard!'); + toast.success(t('results.scanIdCopied')); } catch { - toast.error('Failed to copy Scan ID.'); + toast.error(t('results.scanIdCopyFailed')); } };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/ResultsPage.tsx` around lines 76 - 83, The copyScanId helper in ResultsPage uses hardcoded toast text, bypassing the file’s i18n pattern. Replace the success and error strings in copyScanId with t(...) lookups matching the other user-facing messages in ResultsPage, and ensure the translation keys are added/used consistently so the clipboard toasts are localized.
♻️ Duplicate comments (1)
src/pages/ResultsPage.tsx (1)
142-186: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winCopy button still triggers card navigation — previous fix incomplete.
The Copy button is nested inside the card's
<Link to={\/analysis?id=${h.id}`}>(opened at line 142). TheonClickhandler at line 179 only callscopyScanId; it never callspreventDefault()/stopPropagation(), so the click still bubbles to the anchor and navigates to/analysisinstead of (or alongside) copying. This was previously flagged and is only half-fixed — wrapping in a realwas done, but the event handling was not. Nesting ainside an` is also invalid HTML.🐛 Proposed fix
<button type="button" - onClick={() => copyScanId(h.scan_display_id)} - aria-label="Copy Scan ID" + onClick={(event) => { + event.preventDefault(); + event.stopPropagation(); + void copyScanId(h.scan_display_id); + }} + aria-label={`Copy scan ID ${h.scan_display_id}`} title="Copy Scan ID" className="shrink-0 ml-2 text-on-surface-variant hover:text-neon" >🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/ResultsPage.tsx` around lines 142 - 186, The Copy button inside the ResultsPage card Link still bubbles to the surrounding navigation, so clicking it can trigger /analysis instead of only copying the scan ID. Update the Copy button handler in ResultsPage so it prevents the parent Link navigation by calling preventDefault and stopPropagation before copyScanId, and avoid keeping an interactive button nested inside the Link by restructuring the card actions if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/ResultsPage.tsx`:
- Around line 63-66: The retry button in ResultsPage currently relies on the
default button type, which can accidentally act as a submit button inside a
form. Update the button in ResultsPage to explicitly set type="button" while
keeping the existing onClick reload behavior and styling, so it only triggers
the page refresh action.
---
Outside diff comments:
In `@src/pages/PublicReport.tsx`:
- Around line 33-44: The clipboard-copy flow in copyReportUrl duplicates the
same try/catch/toast pattern used by copyScanId and diverges from ScannerPage,
so extract a shared copyToClipboard helper or hook and use it here instead. Move
the clipboard write plus success/error toast handling into the shared utility,
then have PublicReport’s copyReportUrl call that helper with the report URL and
its success/error messages so all three pages behave consistently.
- Around line 37-44: The new copy-to-clipboard UI strings in PublicReport are
still hardcoded English, so update the heading, copy button aria-label/title,
and both toast messages to use the existing i18n pattern with t(...). Use the
same translation approach already used elsewhere in PublicReport.tsx and keep
the string keys consistent around the copyReportUrl handler and the “PUBLIC
REPORT URL” section so all user-facing text is localized.
- Around line 1-135: The PR description says this change should automatically
apply a single complexity label, but the current `PublicReport` update only adds
the clipboard UI and does not reflect any labeling behavior. Update the
PR/labeling logic associated with this change so it assigns the correct one
label (`complexity: basic`) based on the described scope, and verify the label
selection flow uses the existing review/analysis output rather than hardcoding
page UI details.
In `@src/pages/ResultsPage.tsx`:
- Around line 76-83: The copyScanId helper in ResultsPage uses hardcoded toast
text, bypassing the file’s i18n pattern. Replace the success and error strings
in copyScanId with t(...) lookups matching the other user-facing messages in
ResultsPage, and ensure the translation keys are added/used consistently so the
clipboard toasts are localized.
---
Duplicate comments:
In `@src/pages/ResultsPage.tsx`:
- Around line 142-186: The Copy button inside the ResultsPage card Link still
bubbles to the surrounding navigation, so clicking it can trigger /analysis
instead of only copying the scan ID. Update the Copy button handler in
ResultsPage so it prevents the parent Link navigation by calling preventDefault
and stopPropagation before copyScanId, and avoid keeping an interactive button
nested inside the Link by restructuring the card actions if needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5b815e8b-8dcc-4b2b-b0a8-b92c10867c06
📒 Files selected for processing (2)
src/pages/PublicReport.tsxsrc/pages/ResultsPage.tsx
🛑 Comments failed to post (1)
src/pages/ResultsPage.tsx (1)
63-66: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Add explicit
type="button".Flagged by static analysis: a
<button>with notypedefaults tosubmit, which can accidentally submit an enclosing form.🔧 Proposed fix
<button + type="button" onClick={() => window.location.reload()} className="text-neon font-[family-name:var(--font-mono)] text-xs tracking-widest no-underline hover:underline bg-transparent border-none cursor-pointer" >{t('common.tryAgain')}</button>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.<button type="button" onClick={() => window.location.reload()} className="text-neon font-[family-name:var(--font-mono)] text-xs tracking-widest no-underline hover:underline bg-transparent border-none cursor-pointer" >{t('common.tryAgain')}</button>🧰 Tools
🪛 React Doctor (0.5.8)
[warning] 63-63: Your users can submit the form by accident because a
<button>with notypedefaults to submit.Set an explicit button
typeso plain buttons do not submit forms by accident:type="button","submit", or"reset".(button-has-type)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/ResultsPage.tsx` around lines 63 - 66, The retry button in ResultsPage currently relies on the default button type, which can accidentally act as a submit button inside a form. Update the button in ResultsPage to explicitly set type="button" while keeping the existing onClick reload behavior and styling, so it only triggers the page refresh action.Source: Linters/SAST tools
|
Hello @jpdevhub , Removed the obsolete Copy Share Link button and kept the new copy icon for the public report URL. |
Description:
Added a clipboard icon next to scan_display_id in ResultsPage.
Closes #121
Changes:
Testing:
Summary by CodeRabbit
Summary by CodeRabbit
New Features
UI Updates